export const MEMBER_LEVELS = [
  { 
    value: 'bronze', 
    label: '铜牌会员', 
    color: 'default',
    minPoints: 0,
    maxPoints: 499
  },
  { 
    value: 'silver', 
    label: '银牌会员', 
    color: 'blue',
    minPoints: 500,
    maxPoints: 1499
  },
  { 
    value: 'gold', 
    label: '金牌会员', 
    color: 'gold',
    minPoints: 1500,
    maxPoints: 2999
  },
  { 
    value: 'platinum', 
    label: '铂金会员', 
    color: 'purple',
    minPoints: 3000,
    maxPoints: Infinity
  }
];

export const getLevelByPoints = (points) => {
  return MEMBER_LEVELS.find(
    level => points >= level.minPoints && points <= level.maxPoints
  ) || MEMBER_LEVELS[0];
};

export const getLevelConfig = (levelValue) => {
  return MEMBER_LEVELS.find(level => level.value === levelValue) || MEMBER_LEVELS[0];
};
